#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 2e5 + 10;
int arr[N];
struct S
{
	int idx;
	int x;
}s[N];
int n;
int cmp(S a, S b)
{
	return a.x > b.x;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(arr, 0, sizeof(arr));
		memset(s, 0, sizeof(s));
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
			s[i].x = arr[i];
			s[i].idx = i;
		}
		sort(s, s + n, cmp);
		for (int i = 0; i < n; i++) {
			int k = arr[i];
			int res = 0;
			for (int j = 0; j < n; j++) {
				if (s[j].idx != i) {
					res = s[j].x;
					break;
				}
			}
			cout << k - res << " ";
		}
		cout << endl;
	}
	return 0;
}